/*
                    _____           _____
	\    / |     | |        |     |   |
	 \  /  |     | |—————   |     |   |
	  \/    \___/  |_____    \___/  __|__


		---- create by millent
			 github @jon-millent

			 @copy right
*/




;(function(Vue,root){
	//禁用滚动帮助


	//格式化日期
	Date.prototype.Format = function (fmt) {
	    var o = {
		"M+": this.getMonth() + 1, //月份
		"d+": this.getDate(), //日
		"h+": this.getHours(), //小时
		"m+": this.getMinutes(), //分
		"s+": this.getSeconds(), //秒
		"q+": Math.floor((this.getMonth() + 3) / 3), //季度
		"S": this.getMilliseconds() //毫秒
	    };
	    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
	    for (var k in o)
		if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
	    return fmt;
	}
	Date.prototype.getFullTime = function(){
		return this.Format('yyyy-MM-dd hh:mm:ss');
	}
	//首字母大写
	String.prototype.firstUpperCase=function(){
	    return this.replace(/^\S/,function(s){return s.toUpperCase();});
	}
	//去空格
	String.prototype.isTrim = function(){
		return this.replace(/\s/g,'');
	}
	//空
	String.prototype.isEmpty = function(){
		return this.replace(/\s/g,'') == "";
	}
	//判断电话号码
	String.prototype.isPhoneNumber = function(){
		return /^1[34578]\d{9}$/.test(this);
	}
	//判断英文或者数字
	String.prototype.isEnglishAndNumber = function(){
		return !/^[a-z0-9][a-z\-\_0-9]+?[a-z0-9]$/i.test(this);
	}
	root.toEmpty = function(objs){
		for(var i in objs){
			objs[i] = "";
		}
	}

	Date.prototype.getNormalTime = function(){
		return new Date().Format('yyyy-MM-ddThh:mm:ss');
	}

//内部代码使用的公共工具
	window.ToolList = {
		backBoolean : function(obj){
			if(typeof obj == 'string'){
				return obj == "true" ? true : false
			}
			return obj
		},
		extends : function(a,b){
			for(var i in b){
				a[i] = b[i]
			}

			return a;
		},
		setTransform : function(obj,key,value){
			var bower = ['moz','ms','o','webkit',''];

			for(var i=0; i<bower.length; i++){
				if(bower[i] != ''){
					obj.style[bower[i]+key.firstUpperCase()] = value;
				}else{
					obj.style[key] = value;
				}

			}
		}
	};
    var STOPMOVE = function(e){e.preventDefault();};

	// 公用的 rose util tool
	root.rose = {

		getUrl : baseUrl,

		util : {
			stopScroll : function(){
				document.body.style.overflow='hidden';
			},
			runScroll : function(){

                document.body.style.overflow='';
			},
			addHash: function () {

				// exit if the browser implements that event
				if ("onhashchange" in window) { return; }

				var location = window.location,
					oldURL = location.href,
					oldHash = location.hash;

				// check the location hash on a 100ms interval
				setInterval(function() {
					var newURL = location.href,
						newHash = location.hash;

					// if the hash has changed and a handler has been bound...
					if (newHash != oldHash && typeof window.onhashchange === "function") {
						// execute the handler
						window.onhashchange({
							type: "hashchange",
							oldURL: oldURL,
							newURL: newURL
						});

						oldURL = newURL;
						oldHash = newHash;
					}
				}, 100);

            },
			getReauest : function() {
			   var url = location.search; //获取url中"?"符后的字串
			   var theRequest = new Object();
			   if (url.indexOf("?") != -1) {
			      var str = url.substr(1);
			      strs = str.split("&");
			      for(var i = 0; i < strs.length; i ++) {
			         theRequest[strs[i].split("=")[0]]=decodeURIComponent(strs[i].split("=")[1]);
			      }
			   }
			   return theRequest;
		   },
		   getStates : [
			   {
			   		name : "全部"
		   	   },{
			   		name : "等待生产",
					code : 0
		   	   },{
			   		name : "正在生产",
					code : 1
		   	   },{
				   name : "暂停",
				   code : 2
			   },{
				   name : "完成",
				   code : 3
			   },{
				   name : "删除",
				   code : 4
			   }
	   		],
			getJavaTime: function (str) {
				return this.getPhoneTime(str)
            },
			getH5Time: function (str) {
				return str ? new Date(str.time).Format('yyyy-MM-ddThh:mm') : '';
    		},
            getH5Time1: function (str) {
                return str ? new Date(str.time).Format('yyyy-MM-dd') : '';
            },
			setItem:function (key,value) {
				if(window.localStorage){
					window.localStorage.setItem(key,value);
				}else{
					$.fn.cookie(key,value,{
                        path: '/',
                        expires : 10000000
                    });
				}
            },
			getItem:function (key) {
                if(window.localStorage){
                	return window.localStorage.getItem(key);
				}else{
                    return $.fn.cookie(key);
				}
            },
			removeItem:function (key) {
                if(window.localStorage){
                    window.localStorage.removeItem(key);
                }else{
					$.fn.cookie(key,'',{
                        path: '/',
                        expires : -10000000
                    });
                }
            },
            getIndexDay : function(AddDayCount) {
                function getDateStr(dayCount){
                    if(null == dayCount){
                        dayCount = 0;
                    }
                    var dd = new Date();
                    dd.setDate(dd.getDate()+dayCount);//设置日期
                    var y = dd.getFullYear();
                    var m = dd.getMonth()+1;//获取当前月份的日期
                    var d = dd.getDate();

                    dd.setHours(0);
                    dd.setMinutes(0);
                    dd.setSeconds(0);

                    return dd
                }
                // var dd = new Date();
				// dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
				// var y = dd.getFullYear();
				// var m = dd.getMonth()+1;//获取当前月份的日期
				// var d = dd.getDate();
				return  new Date(getDateStr(AddDayCount)).Format('yyyy-MM-dd hh:mm:ss');
			},
			getPhoneTime: function (str) {

				var t = str.replace(/[T|+]/,' ') || '';
				var sub = t.indexOf('.');

				if(sub != -1){
					t = t.substr(0,sub);
				}

				return t || '';

            },
			getTodayBeginTime: function () {
				return this.getIndexDay(0)
            },
			getTodayEndTime: function () {
                function getDateStr(dayCount){
                    if(null == dayCount){
                        dayCount = 0;
                    }
                    var dd = new Date();
                    dd.setDate(dd.getDate()+dayCount);//设置日期
                    var y = dd.getFullYear();
                    var m = dd.getMonth()+1;//获取当前月份的日期
                    var d = dd.getDate();

                    dd.setHours(23);
                    dd.setMinutes(59);
                    dd.setSeconds(59);

                    return dd
                }
                // var dd = new Date();
                // dd.setDate(dd.getDate()+AddDayCount);//获取AddDayCount天后的日期
                // var y = dd.getFullYear();
                // var m = dd.getMonth()+1;//获取当前月份的日期
                // var d = dd.getDate();

                return  new Date(getDateStr()).Format('yyyy-MM-dd hh:mm:ss');
            }

		}
	};

	rose.util.setItem('admin_compid', '01');
	rose.util.setItem('admin_empname', '1');
	rose.util.setItem('admin_opid', '0295');
	rose.util.setItem('admin_token', 'D1F12E33EC9EAF5DD9E578E0A3B3F246');
	rose.util.setItem('emptype', '2');

})(Vue,window);





!function(){"use strict";function t(e,o){function i(t,e){return function(){return t.apply(e,arguments)}}var r;if(o=o||{},this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=o.touchBoundary||10,this.layer=e,this.tapDelay=o.tapDelay||200,this.tapTimeout=o.tapTimeout||700,!t.notNeeded(e)){for(var a=["onMouse","onClick","onTouchStart","onTouchMove","onTouchEnd","onTouchCancel"],c=this,s=0,u=a.length;u>s;s++)c[a[s]]=i(c[a[s]],c);n&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,o){var i=Node.prototype.removeEventListener;"click"===t?i.call(e,t,n.hijacked||n,o):i.call(e,t,n,o)},e.addEventListener=function(t,n,o){var i=Node.prototype.addEventListener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),o):i.call(e,t,n,o)}),"function"==typeof e.onclick&&(r=e.onclick,e.addEventListener("click",function(t){r(t)},!1),e.onclick=null)}}var e=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!e,o=/iP(ad|hone|od)/.test(navigator.userAgent)&&!e,i=o&&/OS 4_\d(_\d)?/.test(navigator.userAgent),r=o&&/OS [6-7]_\d/.test(navigator.userAgent),a=navigator.userAgent.indexOf("BB10")>0;t.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(o&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},t.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},t.prototype.sendClick=function(t,e){var n,o;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),o=e.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},t.prototype.determineEventType=function(t){return n&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},t.prototype.focus=function(t){var e;o&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},t.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},t.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},t.prototype.onTouchStart=function(t){var e,n,r;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],o){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!i){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTime<this.tapDelay&&t.preventDefault(),!0},t.prototype.touchHasMoved=function(t){var e=t.changedTouches[0],n=this.touchBoundary;return Math.abs(e.pageX-this.touchStartX)>n||Math.abs(e.pageY-this.touchStartY)>n?!0:!1},t.prototype.onTouchMove=function(t){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},t.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},t.prototype.onTouchEnd=function(t){var e,a,c,s,u,l=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTime<this.tapDelay)return this.cancelNextClick=!0,!0;if(t.timeStamp-this.trackingClickStart>this.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,a=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,r&&(u=t.changedTouches[0],l=document.elementFromPoint(u.pageX-window.pageXOffset,u.pageY-window.pageYOffset)||l,l.fastClickScrollParent=this.targetElement.fastClickScrollParent),c=l.tagName.toLowerCase(),"label"===c){if(e=this.findControl(l)){if(this.focus(l),n)return!1;l=e}}else if(this.needsFocus(l))return t.timeStamp-a>100||o&&window.top!==window&&"input"===c?(this.targetElement=null,!1):(this.focus(l),this.sendClick(l,t),o&&"select"===c||(this.targetElement=null,t.preventDefault()),!1);return o&&!i&&(s=l.fastClickScrollParent,s&&s.fastClickLastScrollTop!==s.scrollTop)?!0:(this.needsClick(l)||(t.preventDefault(),this.sendClick(l,t)),!1)},t.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},t.prototype.onMouse=function(t){return this.targetElement?t.forwardedTouchEvent?!0:t.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1):!0:!0},t.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail?!0:(e=this.onMouse(t),e||(this.targetElement=null),e)},t.prototype.destroy=function(){var t=this.layer;n&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},t.notNeeded=function(t){var e,o,i,r;if("undefined"==typeof window.ontouchstart)return!0;if(o=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(e=document.querySelector("meta[name=viewport]")){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(o>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(a&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(e=document.querySelector("meta[name=viewport]")))){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction?!0:(r=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],r>=27&&(e=document.querySelector("meta[name=viewport]"),e&&(-1!==e.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===t.style.touchAction||"manipulation"===t.style.touchAction?!0:!1)},t.attach=function(e,n){return new t(e,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return t}):"undefined"!=typeof module&&module.exports?(module.exports=t.attach,module.exports.FastClick=t):window.FastClick=t}();

if ('addEventListener' in document) {
    document.addEventListener('DOMContentLoaded', function() {
        FastClick.attach(document.body);
    }, false);
}